<template>
    <form class="searchbar">
        <input class="searchbar__input" type="text" placeholder="输入要搜索的业务编号" v-model="searchText">
        <button class="searchbar__btn" type="submit" v-on:click="searchFn(searchText)">搜索</button>
    </form>
</template>

<script>
export default {
    name: "Searchbar",
    data() {
        return {
            searchText: null
        };
    },
    mounted() {
        layui.use("element", function() {
            var element = layui.element;
        });
    },
    methods: {
        searchFn: function(data) {
            this.$store.commit("changBusinessNo", data);
        }
    }
};
</script>
<style scoped>
.searchbar {
    display: flex;
    justify-content: space-between;
    width: 400px;
    height: 35px;
    margin: auto;
    padding: 2px;
    background: #009688;
}
.searchbar .searchbar__input {
    width: 315px;
    padding: 0 10px;
    vertical-align: middle;
    border: none;
    background: #fff;
}
.searchbar .searchbar__btn {
    width: calc(100% - 315px);
    color: #fff;
    font-size: 15px;
    text-align: center;
    border: none;
    background: #009688;
    cursor: pointer;
}
</style>
